#include <stdio.h>
#include <stdlib.h> 
#include <pthread.h> 
#include "Reine.h"
#include "Oeuf.h"

Reine :: Reine(Fourmilliere* fm) : Fourmi(fm)
{
	jours_vie = 100000000;
}

void Reine :: nee()
{
	if(fm != NULL)
		fm->ReineIsBorn();
}
void Reine :: travaille()
{
	if(fm != NULL && fm->GetPV() > fm->GetPopulationTotale())
	{
		int Oeufs = fm->NB_Oeufs_Max_A_Pondre();

		if(Oeufs == 0)
			Oeufs = rand()%2;

		else if(Oeufs < 0)
			Oeufs = 0;

		else
			Oeufs = rand() % Oeufs;
		
		while(Oeufs != 0)
		{
			new Oeuf(fm);
			Oeufs--;
		}
		
	}	
}
void Reine :: meurt()
{
	if(fm != NULL)
		fm->ReineIsDead();
}

